<?php
namespace Plu\qdh\Models\App;

use Phalcon\Mvc\Model;

class Platform extends Model
{

    // CREATE TABLE `platform` (
    //     `id` int(11) NOT NULL AUTO_INCREMENT,
    //     `platformName` varchar(45) NOT NULL COMMENT '平台名称',
    //     `createTime` varchar(45) NOT NULL,
    //     PRIMARY KEY (`id`)
    //   ) ENGINE=InnoDB DEFAULT CHARSET=utf8

    public function initialize() {
        $this->setConnectionService('db.qdh');
        $this->allowEmptyStringValues([]);
    }

	public function getSource() {
		return "platform";
    }
    
    static public function getItemById($Id) {
        $item = self::findFirst([
            'conditions' => 'id = :id:',
            'bind' => [
                'id' => $Id
            ]
        ]);
        return $item;
    }


    static public function getItems() {
        $items = self::find();
        if ($items) {
            return $items->toArray();
        }
        return [];
    }





}